/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.mapperv3.provider;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.taobao.ibatiside.model.mapperv3.DocumentRoot;
import org.taobao.ibatiside.model.mapperv3.Mapperv3Factory;
import org.taobao.ibatiside.model.mapperv3.Mapperv3Package;

/**
 * This is the item provider adapter for a {@link org.taobao.ibatiside.model.mapperv3.DocumentRoot} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class DocumentRootItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DocumentRootItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

		}
		return itemPropertyDescriptors;
	}

	/**
	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
		if (childrenFeatures == null) {
			super.getChildrenFeatures(object);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__ARG);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__ASSOCIATION);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__CACHE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__CACHE_REF);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__CASE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__CHOOSE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__COLLECTION);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__CONSTRUCTOR);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__DELETE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__DISCRIMINATOR);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__FOREACH);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__ID);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__ID_ARG);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__IF);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__INCLUDE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__INSERT);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__MAPPER);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__OTHERWISE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__PARAMETER);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__PARAMETER_MAP);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__PROPERTY);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__RESULT);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__RESULT_MAP);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__SELECT);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__SELECT_KEY);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__SET);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__SQL);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__TRIM);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__TYPE_ALIAS);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__UPDATE);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__WHEN);
			childrenFeatures.add(Mapperv3Package.Literals.DOCUMENT_ROOT__WHERE);
		}
		return childrenFeatures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EStructuralFeature getChildFeature(Object object, Object child) {
		// Check the type of the specified child object and return the proper feature to use for
		// adding (see {@link AddCommand}) it as a child.

		return super.getChildFeature(object, child);
	}

	/**
	 * This returns DocumentRoot.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/DocumentRoot"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		return getString("_UI_DocumentRoot_type");
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(DocumentRoot.class)) {
			case Mapperv3Package.DOCUMENT_ROOT__ARG:
			case Mapperv3Package.DOCUMENT_ROOT__ASSOCIATION:
			case Mapperv3Package.DOCUMENT_ROOT__CACHE:
			case Mapperv3Package.DOCUMENT_ROOT__CACHE_REF:
			case Mapperv3Package.DOCUMENT_ROOT__CASE:
			case Mapperv3Package.DOCUMENT_ROOT__CHOOSE:
			case Mapperv3Package.DOCUMENT_ROOT__COLLECTION:
			case Mapperv3Package.DOCUMENT_ROOT__CONSTRUCTOR:
			case Mapperv3Package.DOCUMENT_ROOT__DELETE:
			case Mapperv3Package.DOCUMENT_ROOT__DISCRIMINATOR:
			case Mapperv3Package.DOCUMENT_ROOT__FOREACH:
			case Mapperv3Package.DOCUMENT_ROOT__ID:
			case Mapperv3Package.DOCUMENT_ROOT__ID_ARG:
			case Mapperv3Package.DOCUMENT_ROOT__IF:
			case Mapperv3Package.DOCUMENT_ROOT__INCLUDE:
			case Mapperv3Package.DOCUMENT_ROOT__INSERT:
			case Mapperv3Package.DOCUMENT_ROOT__MAPPER:
			case Mapperv3Package.DOCUMENT_ROOT__OTHERWISE:
			case Mapperv3Package.DOCUMENT_ROOT__PARAMETER:
			case Mapperv3Package.DOCUMENT_ROOT__PARAMETER_MAP:
			case Mapperv3Package.DOCUMENT_ROOT__PROPERTY:
			case Mapperv3Package.DOCUMENT_ROOT__RESULT:
			case Mapperv3Package.DOCUMENT_ROOT__RESULT_MAP:
			case Mapperv3Package.DOCUMENT_ROOT__SELECT:
			case Mapperv3Package.DOCUMENT_ROOT__SELECT_KEY:
			case Mapperv3Package.DOCUMENT_ROOT__SET:
			case Mapperv3Package.DOCUMENT_ROOT__SQL:
			case Mapperv3Package.DOCUMENT_ROOT__TRIM:
			case Mapperv3Package.DOCUMENT_ROOT__TYPE_ALIAS:
			case Mapperv3Package.DOCUMENT_ROOT__UPDATE:
			case Mapperv3Package.DOCUMENT_ROOT__WHEN:
			case Mapperv3Package.DOCUMENT_ROOT__WHERE:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__ARG,
				 Mapperv3Factory.eINSTANCE.createArg()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__ASSOCIATION,
				 Mapperv3Factory.eINSTANCE.createAssociation()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__CACHE,
				 Mapperv3Factory.eINSTANCE.createCache()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__CACHE_REF,
				 Mapperv3Factory.eINSTANCE.createCacheRef()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__CASE,
				 Mapperv3Factory.eINSTANCE.createCase()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__CHOOSE,
				 Mapperv3Factory.eINSTANCE.createChoose()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__COLLECTION,
				 Mapperv3Factory.eINSTANCE.createCollection()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__CONSTRUCTOR,
				 Mapperv3Factory.eINSTANCE.createConstructor()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__DELETE,
				 Mapperv3Factory.eINSTANCE.createDelete()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__DISCRIMINATOR,
				 Mapperv3Factory.eINSTANCE.createDiscriminator()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__FOREACH,
				 Mapperv3Factory.eINSTANCE.createForeach()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__ID,
				 Mapperv3Factory.eINSTANCE.createId()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__ID_ARG,
				 Mapperv3Factory.eINSTANCE.createIdArg()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__IF,
				 Mapperv3Factory.eINSTANCE.createIf()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__INCLUDE,
				 Mapperv3Factory.eINSTANCE.createInclude()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__INSERT,
				 Mapperv3Factory.eINSTANCE.createInsert()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__MAPPER,
				 Mapperv3Factory.eINSTANCE.createMapper()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__OTHERWISE,
				 Mapperv3Factory.eINSTANCE.createOtherwise()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__PARAMETER,
				 Mapperv3Factory.eINSTANCE.createParameter()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__PARAMETER_MAP,
				 Mapperv3Factory.eINSTANCE.createParameterMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__PROPERTY,
				 Mapperv3Factory.eINSTANCE.createProperty()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__RESULT,
				 Mapperv3Factory.eINSTANCE.createResult()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__RESULT_MAP,
				 Mapperv3Factory.eINSTANCE.createResultMap()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__SELECT,
				 Mapperv3Factory.eINSTANCE.createSelect()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__SELECT_KEY,
				 Mapperv3Factory.eINSTANCE.createSelectKey()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__SET,
				 Mapperv3Factory.eINSTANCE.createSet()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__SQL,
				 Mapperv3Factory.eINSTANCE.createSql()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__TRIM,
				 Mapperv3Factory.eINSTANCE.createTrim()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__TYPE_ALIAS,
				 Mapperv3Factory.eINSTANCE.createTypeAlias()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__UPDATE,
				 Mapperv3Factory.eINSTANCE.createUpdate()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__WHEN,
				 Mapperv3Factory.eINSTANCE.createWhen()));

		newChildDescriptors.add
			(createChildParameter
				(Mapperv3Package.Literals.DOCUMENT_ROOT__WHERE,
				 Mapperv3Factory.eINSTANCE.createWhere()));
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return Map3xEditPlugin.INSTANCE;
	}

}
